Optimal. Leaf size=129 \[ -\frac {1}{2} c^2 d^2 x^2 \left (a+b \tan ^{-1}(c x)\right )+2 i a c d^2 x+a d^2 \log (x)-i b d^2 \log \left (c^2 x^2+1\right )+\frac {1}{2} i b d^2 \text {Li}_2(-i c x)-\frac {1}{2} i b d^2 \text {Li}_2(i c x)+\frac {1}{2} b c d^2 x-\frac {1}{2} b d^2 \tan ^{-1}(c x)+2 i b c d^2 x \tan ^{-1}(c x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 129, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 8, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {4876, 4846, 260, 4848, 2391, 4852, 321, 203} \[ \frac {1}{2} i b d^2 \text {PolyLog}(2,-i c x)-\frac {1}{2} i b d^2 \text {PolyLog}(2,i c x)-\frac {1}{2} c^2 d^2 x^2 \left (a+b \tan ^{-1}(c x)\right )+2 i a c d^2 x+a d^2 \log (x)-i b d^2 \log \left (c^2 x^2+1\right )+\frac {1}{2} b c d^2 x-\frac {1}{2} b d^2 \tan ^{-1}(c x)+2 i b c d^2 x \tan ^{-1}(c x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 260
Rule 321
Rule 2391
Rule 4846
Rule 4848
Rule 4852
Rule 4876
Rubi steps
\begin {align*} \int \frac {(d+i c d x)^2 \left (a+b \tan ^{-1}(c x)\right )}{x} \, dx &=\int \left (2 i c d^2 \left (a+b \tan ^{-1}(c x)\right )+\frac {d^2 \left (a+b \tan ^{-1}(c x)\right )}{x}-c^2 d^2 x \left (a+b \tan ^{-1}(c x)\right )\right ) \, dx\\ &=d^2 \int \frac {a+b \tan ^{-1}(c x)}{x} \, dx+\left (2 i c d^2\right ) \int \left (a+b \tan ^{-1}(c x)\right ) \, dx-\left (c^2 d^2\right ) \int x \left (a+b \tan ^{-1}(c x)\right ) \, dx\\ &=2 i a c d^2 x-\frac {1}{2} c^2 d^2 x^2 \left (a+b \tan ^{-1}(c x)\right )+a d^2 \log (x)+\frac {1}{2} \left (i b d^2\right ) \int \frac {\log (1-i c x)}{x} \, dx-\frac {1}{2} \left (i b d^2\right ) \int \frac {\log (1+i c x)}{x} \, dx+\left (2 i b c d^2\right ) \int \tan ^{-1}(c x) \, dx+\frac {1}{2} \left (b c^3 d^2\right ) \int \frac {x^2}{1+c^2 x^2} \, dx\\ &=2 i a c d^2 x+\frac {1}{2} b c d^2 x+2 i b c d^2 x \tan ^{-1}(c x)-\frac {1}{2} c^2 d^2 x^2 \left (a+b \tan ^{-1}(c x)\right )+a d^2 \log (x)+\frac {1}{2} i b d^2 \text {Li}_2(-i c x)-\frac {1}{2} i b d^2 \text {Li}_2(i c x)-\frac {1}{2} \left (b c d^2\right ) \int \frac {1}{1+c^2 x^2} \, dx-\left (2 i b c^2 d^2\right ) \int \frac {x}{1+c^2 x^2} \, dx\\ &=2 i a c d^2 x+\frac {1}{2} b c d^2 x-\frac {1}{2} b d^2 \tan ^{-1}(c x)+2 i b c d^2 x \tan ^{-1}(c x)-\frac {1}{2} c^2 d^2 x^2 \left (a+b \tan ^{-1}(c x)\right )+a d^2 \log (x)-i b d^2 \log \left (1+c^2 x^2\right )+\frac {1}{2} i b d^2 \text {Li}_2(-i c x)-\frac {1}{2} i b d^2 \text {Li}_2(i c x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.10, size = 103, normalized size = 0.80 \[ -\frac {1}{2} d^2 \left (a c^2 x^2-4 i a c x-2 a \log (x)+2 i b \log \left (c^2 x^2+1\right )+b c^2 x^2 \tan ^{-1}(c x)-i b \text {Li}_2(-i c x)+i b \text {Li}_2(i c x)-b c x-4 i b c x \tan ^{-1}(c x)+b \tan ^{-1}(c x)\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.49, size = 0, normalized size = 0.00 \[ {\rm integral}\left (-\frac {2 \, a c^{2} d^{2} x^{2} - 4 i \, a c d^{2} x - 2 \, a d^{2} - {\left (-i \, b c^{2} d^{2} x^{2} - 2 \, b c d^{2} x + i \, b d^{2}\right )} \log \left (-\frac {c x + i}{c x - i}\right )}{2 \, x}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \mathit {sage}_{0} x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.05, size = 177, normalized size = 1.37 \[ 2 i a c \,d^{2} x -\frac {d^{2} a \,c^{2} x^{2}}{2}+a \,d^{2} \ln \left (c x \right )+2 i b c \,d^{2} x \arctan \left (c x \right )-\frac {d^{2} b \arctan \left (c x \right ) c^{2} x^{2}}{2}+d^{2} b \ln \left (c x \right ) \arctan \left (c x \right )+\frac {b c \,d^{2} x}{2}-i b \,d^{2} \ln \left (c^{2} x^{2}+1\right )-\frac {b \,d^{2} \arctan \left (c x \right )}{2}+\frac {i d^{2} b \ln \left (c x \right ) \ln \left (i c x +1\right )}{2}-\frac {i d^{2} b \ln \left (c x \right ) \ln \left (-i c x +1\right )}{2}+\frac {i d^{2} b \dilog \left (i c x +1\right )}{2}-\frac {i d^{2} b \dilog \left (-i c x +1\right )}{2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.61, size = 142, normalized size = 1.10 \[ -\frac {1}{2} \, a c^{2} d^{2} x^{2} + 2 i \, a c d^{2} x + \frac {1}{2} \, b c d^{2} x - \frac {1}{4} \, \pi b d^{2} \log \left (c^{2} x^{2} + 1\right ) + b d^{2} \arctan \left (c x\right ) \log \left (c x\right ) + i \, {\left (2 \, c x \arctan \left (c x\right ) - \log \left (c^{2} x^{2} + 1\right )\right )} b d^{2} - \frac {1}{2} i \, b d^{2} {\rm Li}_2\left (i \, c x + 1\right ) + \frac {1}{2} i \, b d^{2} {\rm Li}_2\left (-i \, c x + 1\right ) + a d^{2} \log \relax (x) - \frac {1}{2} \, {\left (b c^{2} d^{2} x^{2} + b d^{2}\right )} \arctan \left (c x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.73, size = 131, normalized size = 1.02 \[ \left \{\begin {array}{cl} a\,d^2\,\ln \relax (x) & \text {\ if\ \ }c=0\\ \frac {b\,c\,d^2\,x}{2}+\frac {a\,d^2\,\left (2\,\ln \relax (x)-c^2\,x^2+c\,x\,4{}\mathrm {i}\right )}{2}-\frac {b\,d^2\,{\mathrm {Li}}_{\mathrm {2}}\left (1-c\,x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}+\frac {b\,d^2\,{\mathrm {Li}}_{\mathrm {2}}\left (1+c\,x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}-b\,d^2\,\ln \left (c^2\,x^2+1\right )\,1{}\mathrm {i}-b\,c^2\,d^2\,\mathrm {atan}\left (c\,x\right )\,\left (\frac {1}{2\,c^2}+\frac {x^2}{2}\right )+b\,c\,d^2\,x\,\mathrm {atan}\left (c\,x\right )\,2{}\mathrm {i} & \text {\ if\ \ }c\neq 0 \end {array}\right . \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ - d^{2} \left (\int \left (- \frac {a}{x}\right )\, dx + \int \left (- 2 i a c\right )\, dx + \int a c^{2} x\, dx + \int \left (- \frac {b \operatorname {atan}{\left (c x \right )}}{x}\right )\, dx + \int \left (- 2 i b c \operatorname {atan}{\left (c x \right )}\right )\, dx + \int b c^{2} x \operatorname {atan}{\left (c x \right )}\, dx\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________